<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8" %>
<%@page import="com.liuya.db.sql.xml.ExprGroupTypeItem" %>
<%@page import="com.liuya.db.sql.xml.ExprGroup" %>
<%@ page import="com.liuya.common.I18N" %>

<%
    I18N i18n = I18N.getInstance();

    String id = request.getParameter("id");
    String nodeId = request.getParameter("nodeId");
    Object obj = request.getAttribute("item");
    ExprGroupTypeItem item = null;
    ExprGroup group = null;

    if (obj instanceof ExprGroupTypeItem) {
        item = (ExprGroupTypeItem) obj;
        group = item.getExprGroup();
    } else if (obj instanceof ExprGroup) {
        group = (ExprGroup) obj;
    }
%>


<%if (group != null) { %>
<a href="javascript:addExprChildExpr('<%=nodeId%>','binary')"><%=i18n.say("Add_binary_expression")%>
</a><br/>
<a href="javascript:addExprChildExpr('<%=nodeId%>','in')"><%=i18n.say("Add_in_expression")%>
</a><br/>
<a href="javascript:addExprChildExpr('<%=nodeId%>','null')"><%=i18n.say("Add_null_expression")%>
</a><br/>
<a href="javascript:addExprChildExprGroup('<%=nodeId%>')"><%=i18n.say("Add_expression_group")%>
</a><br/>
<a href="javascript:editExprGroupType('<%=nodeId%>','<%=group.getLinker().toString()%>')"><%=i18n.say("Edit")%>
</a><br/>
<% } else {%>
<a href="javascript:editExpr('<%=nodeId%>')"><%=i18n.say("Edit")%>
</a><br/>
<% } %>

<% if (!"0".equals(nodeId)) { %>
<a href="javascript:deleteExpr('<%=nodeId%>')"><%=i18n.say("Delete")%>
</a>
<% } %>
